#include<iostream>
using namespace std;
int main()
{
	int x, y;
	while (cin >> x >> y)
	{
		if (x > y) {
			int temp = x;
			x = y;
			y = temp;
		}
		int ans1 = 0;
		int ans2 = 0;
		for (int i = x; i <= y; i++)
		{
			if (i % 2 == 0)
			{
				ans1 += i * i;
			}
			else
			{
				ans2 += i * i * i;
			}
		}
		cout << ans1 << " " << ans2 << endl;
	}
	return 0;
}